import { defineStore } from 'pinia'
import cache from '@/utils/cache'

export const appStore = defineStore('appStore', {
  state: () => ({
    // 国际化
    language: cache.getLanguage(),
    // 组件大小
    componentSize: 'default'
  }),
  persist: {
    storage: localStorage,
    paths: ['language', 'componentSize'],
    debug: false
  },
  getters: {},
  actions: {}
})

export default appStore